home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’89 / ErrApp / errapp.a next >
Encoding:
Text File  |  1989-06-16  |  925 b   |  68 lines  |  [TEXT/MPS ]

  1. ;
  2. ;
  3. DoAddrErr    proc    export
  4.     move    #1,(sp)
  5.     rts
  6.     endp
  7.  
  8. DoillErr    proc    export
  9.     dc.w    $05FF
  10.     rts
  11.     endp
  12.  
  13. DoPrivErr    proc    export
  14.     and.w    #$DFFF,sr
  15.     and.w    #$DFFF,sr
  16.     rts
  17.     endp
  18.  
  19. DoTraceErr    proc    export
  20.     or.w    #$8000,sr
  21.     rts
  22.     endp
  23.  
  24. DoFTrap        proc    export
  25.     dc.w    $FFFF
  26.     rts
  27.     endp
  28.  
  29. DoPack1    proc    export
  30.     dc.w    $A9E8        ;_Pack1
  31.     rts
  32.     endp
  33.  
  34. ;
  35. ; patch to GetResource - syntax is:
  36. ;
  37. ;FUNCTION GetResource(theType: ResType;theID: INTEGER): Handle;
  38. ;    INLINE $A9A0;
  39. ;
  40. ; we stomp on loads of resources of types 'PACK' and 'CODE'
  41. ;
  42.  
  43.     import    saveTrap:DATA
  44.  
  45. GetResPatch    proc    export
  46. ;    DC.W    $A9FF
  47.     move.l    8(sp),d0
  48.     cmp.l    #'PACK',d0
  49.     beq.s    stomp
  50.     cmp.l    #'CODE',d0
  51.     beq.s    stomp
  52.     movea.l    $A78, A0    ; ApplScratch
  53.     jmp    (A0)
  54.     rts
  55. stomp
  56.     moveq    #0,d0        ; set the handle to NIL
  57.     move.l    d0,12(sp)
  58.     move.l    (sp),a0        ; get the return address
  59.     adda.l    #12,sp
  60.     move    #-192,d0    ; resource not found
  61.     move    d0,$A60        ; ResErr
  62.     jmp    (a0)
  63.     DC.B    $C5        ; 'G'
  64.     DC.B    'etResPatch'
  65.     endp
  66.  
  67.     end
  68.